package com.example.vertification.entity;

import lombok.Data;

import javax.persistence.*;

@Entity
@Table(name = "UserShops")
@Data // 这个注解会自动生成getter、setter、equals、hashCode和toString方法
public class UserShop {

    @Id
    @Column(nullable = false)
    private long uid;

    @Column(columnDefinition = "TEXT",nullable = false)
    private String description;

    @Column(columnDefinition = "TEXT",nullable = false)
    private String buys;

    @Column(name = "type")
    @Enumerated(EnumType.STRING)
    private TradeType type; // 消息状态枚举类型


    @Column(nullable = false)
    private long has_get;

    @Column(name = "timestamp",nullable = false)
    private long timestamp; //

    public enum TradeType {
        ALL,
        OnlySelf,
        OnlyYourself
    }





    public UserShop(long uid, String desc, String buys, TradeType type, long has_get, long timestamp) {
        this.uid = uid;
        this.description = desc;
        this.buys = buys;
        this.type = type;
        this.has_get = has_get;
        this.timestamp = timestamp;
    }

    public UserShop() {

    }



}